/*
 * oled_driver.h
 *
 *  Created on: 2024年3月8日
 *      Author: LeiWang
 */

#ifndef OLED_DRIVER_OLED_DRIVER_H_
#define OLED_DRIVER_OLED_DRIVER_H_

#include "main.h"
#include "gpio.h"
#include "i2c.h"

#define OLED_IIC_HANDLE hi2c1

#define OLED_IIC_ADDRESS 0x78	// oled在iic总线的地址

typedef enum{
	OLED_CMD = 0,	// oled写命令
	OLED_DATA		// oled写数据
}OLED_WR_MODE;

void oled_iic_write(uint8_t* data, uint16_t size);
void oled_write_cmd(uint8_t oled_cmd);
void oled_write_data(uint8_t oled_data);
void oled_write_byte(uint8_t data,OLED_WR_MODE mode);
void oled_color_turn(uint8_t i);
void oled_display_turn(uint8_t i);
void oled_display_on(void);
void oled_display_off(void);
void oled_refresh(void);
void oled_clear(void);
void oled_draw_point(uint8_t x,uint8_t y);
void oled_clear_point(uint8_t x,uint8_t y);
void oled_show_char(uint8_t x,uint8_t y,uint8_t chr,uint8_t size1);
void oled_show_string(uint8_t x,uint8_t y,char *chr,uint8_t size1);
uint32_t oled_pow(uint8_t m,uint8_t n);
void oled_show_num(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size1);
void OLED_WR_BP(uint8_t x,uint8_t y);

void oled_init(void);



#endif /* OLED_DRIVER_OLED_DRIVER_H_ */
